import axios from '../../utils/http'

const model = {
    namespaced: true, //形成对立的命名空间
    state: {
        //数据
        roleList: []
    },
    mutations: {
        roleListMutation(state, list) {
            //设置数据
            state.roleList = list
        }
    },
    actions: {
        roleListActions(context) {
            //请求数据
            axios.get("/rolelist").then(res => {
                context.commit("roleListMutation", res.list)
            })
        }
    }
}

export default model